package com.xy.entity.express.express100;

import com.thoughtworks.xstream.XStream;
import lombok.Data;

//快递100订阅响应
@Data
public class TaskResponse {
    private static XStream xstream;
    private Boolean result;
    private String returnCode;
    private String message;



    private static XStream getXStream() {
        if (xstream == null) {
            xstream = new XStream();
            xstream.autodetectAnnotations(true);
            xstream.alias("orderResponse", TaskResponse.class);
        }
        return xstream;
    }

    public String toXml(){
        return "<?xml version='1.0' encoding='UTF-8'?>\r\n" + getXStream().toXML(this);
    }

    public static TaskResponse fromXml(String sXml){
        return (TaskResponse)getXStream().fromXML(sXml);
    }

}
